In databases an index is a data structure, part of the database, used by a database system to effectively navigate access to user data. Index data are system data distinct from user data, and consist primarily of pointers. As user data are changing in a database (by insert, delete, or modify operations), also indexes go over changes to maintain user data access correct.[1] Index locking is a technique used to maintain index integrity. A portion of an index is locked during a database transaction when this portion is being accesses by the transaction as a result of attempt to access related user data. Also special database system's transactions (not user invoked transactions) may be invoked to maintain and modify an index, as part of a system's self-maintenance activities. When a portion of index is locked by a transaction, other transactions may be blocked from accessing this index portion (blocked from modifying, and even from reading it, depending on lock type and needed operation).[1]
Specialized concurrency control techniques exist for accessing indexes. These techniques depend on the index type, and take advantage of its structure. They are typically much more effective than applying to indexes common concurrency control methods applied to user data. Notable and have been widely researched are specialized techniques for B-trees (B-Tree concurrency control[2]) which are regularly used as database indexes.
Index locks are used to coordinate threads accessing indexes concurrently, and typically shorter-lived than the common transaction locks on user data. Often they are called in the professional literature latches[2].